<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('会员套餐包列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('lm:levelpackage:edit')}]];
        var removeFlag = [[${@permission.hasPermi('lm:levelpackage:remove')}]];
        var prefix = ctx + "lm/levelpackage";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "会员套餐包",
                columns: [{
                    radio: true
                },
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'packageName',
                    title: '套餐名称'
                },
                {
                    field: 'packageTimes',
                    title: '套餐次数'
                }
                ,
                {
                    field: 'packagePrice',
                    title: '套餐价位'
                }]
            };
            $.table.init(options);
        });

        /* 添加用户套餐关联-选择套餐-提交 */
        function submitHandler(index, layero) {
            var id = $.table.selectFirstColumns();
            var packageName = $.table.selectColumns("packageName");
            var packageTimes = $.table.selectColumns("packageTimes");
            if (id.length == 0) {
                $.modal.alertWarning("请至少选择一条记录");
                return;
            }
            $.modal.close();
            parent.$('#packageId').val(id.join());
            parent.$('#packageName').val(packageName.join());
            parent.$('#packageTimes').val(packageTimes.join());
        }
    </script>
</body>
</html>